﻿package com.devilcat.dt{
	public class Itemdt {
		public var iid:Number;
		public var uid:Number;
		public var Code:String;
		public var Name:String;
		public var Stat:String;
		public var Effect:Number;
		public var Cost:Number;
		public var NumberOf:int;
		public var Type:String;
		public function Itemdt(){
			
		}
		public function getBase(_Code:String){
			var baseXML:XMLList = Gamedt.itemsXML[_Code];
			Code=_Code;
			Name=baseXML.Name;
			Stat=baseXML.Stat;
			Effect=baseXML.Effect;
			Cost=baseXML.Cost;
			Type=baseXML.Type;
			
		}
		public function setPersonal(_item:Object){
			getBase(_item.Code);
			Code=_item.Code;
			NumberOf=_item.NumberOf;
			iid=_item.iid;
		}

		public function increase(num:int) {
			if(num>0 || (num<0 && NumberOf>=num)){
				NumberOf+=num;
			}
		}		
	}
}